package com.working.wanandroid

import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.os.Bundle
import com.working.libbase.base.BaseActivity
import com.working.libbase.model.BackUpModel
import com.working.libbase.storage.Storage
import com.working.wanandroid.databinding.ActivitySplashBinding
import com.working.wanandroid.main.MainActivity

class SplashActivity : BaseActivity() {

    private val mBinding by binding<ActivitySplashBinding>(R.layout.activity_splash)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding.splash.addGradientAnimListener(object : AnimatorListenerAdapter() {
            override fun onAnimationEnd(animation: Animator?) {
                super.onAnimationEnd(animation)
                MainActivity.start(this@SplashActivity)
                Storage.isBlackMode = true
                Storage.model = BackUpModel("22","33",null,33)
                finish()
            }
        })
    }
}